home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / pnm2ppa.postinst < prev    next >
Text File  |  2009-06-29  |  1KB  |  64 lines

  1. #! /bin/sh
  2. # postinst script for pnm2ppa
  3. #
  4. # see: dh_installdeb(1)
  5. set -e
  6.  
  7. # Variables
  8. CONFFILE="/etc/pnm2ppa.conf"
  9. CONFTMPL="/usr/share/pnm2ppa/pnm2ppa.conf"
  10. MKMAGIC="/usr/share/pnm2ppa/update-magicfilter"
  11.  
  12. # Debconf, baby -- no tests.  It's a dependency for installation.
  13. . /usr/share/debconf/confmodule
  14.  
  15. case "${1}" in
  16.     configure)
  17.     # Make sure we have a config file in place
  18.     if [ ! -f ${CONFFILE} ] ; then
  19.         /usr/bin/install -m644 ${CONFTMPL} ${CONFFILE}
  20.     fi
  21.  
  22.     db_get pnm2ppa/use_debconf
  23.     if [ "${RET}" = "true" ] ; then
  24.         # If conf file already exists, use that
  25.         if [ -f ${CONFFILE} ] ; then
  26.             CONFSRC=${CONFFILE}
  27.         else
  28.             CONFSRC=${CONFTMPL}
  29.         fi
  30.  
  31.         # VERY simple sed replacement
  32.         if [ -f ${CONFSRC} ] ; then
  33.             db_get pnm2ppa/printer_model
  34.             TEMPFILE=`/bin/tempfile`
  35.             # Replace everything following "version " w/model
  36.             /bin/sed -e "s,^\(version \).*$,\1 ${RET}," ${CONFSRC} > \
  37.                 ${TEMPFILE}
  38.             /usr/bin/install -m644 ${TEMPFILE} ${CONFFILE}
  39.             /bin/rm ${TEMPFILE}
  40.         fi
  41.  
  42.         # Simple magicfilter processing...
  43.         db_get pnm2ppa/create_magicfilter
  44.         if [ "${RET}" = "true" ] ; then
  45.             sh $MKMAGIC
  46.         fi
  47.     fi
  48.  
  49.     ;;
  50.     abort-upgrade|abort-remove|abort-deconfigure)
  51.     ;;
  52.     *)
  53.         echo "postinst called with unknown argument \`${1}'" >&2
  54.         exit 1
  55.     ;;
  56. esac
  57.  
  58. # dh_installdeb will replace this with shell code automatically
  59. # generated by other debhelper scripts.
  60.  
  61.  
  62.  
  63. exit 0
  64.